package ant;

import ant.properties.Property;
import world.AntWorld;
import world.Position;

public class Queen extends WOAObject {

	private Colony colony;
	
	/**
	 * @return the colony
	 */
	public Colony getColony() {
		return colony;
	}

	/**
	 * @param colony the colony to set
	 */
	public void setColony(Colony colony) {
		this.colony = colony;
	}

	/**
	 * @param c : the colony of the queen
	 */
	public Queen(AntWorld w, Position p) {
		//super(c.world, new Position (c.getPos().get_map(), c.getPos().getX(), c.getPos().getY()));
		super(w, p);
		

		Colony c = w.colonyCreate(this, p);
		this.setColony(c);
		world.log.info("queen has born");		
		//super(c.world, new Position (c.getPos().get_map(), c.getPos().getX(), c.getPos().getY()));
		// TODO Auto-generated constructor stub
		this.type = "queen";

		adn.set("size", new Property("size", 0));		
		adn.set("weight", new Property("weight", 0));
		adn.set("storage_food", new Property("storage_food", 0));		
		adn.set("speed_max", new Property("speed_max", 0));
		adn.set("acceleration", new Property("acceleration", 0));
	
		
		//adn.put("size", new Property("size", 2));
		
		setMyBody(c.world.antBox.create_body(adn.getCurrent("size"), adn.getCurrent("weight"), c.myBody.getPosition()));
		}

	public void life()
	{
		
		world.log.debug(id + " queen is living food : " + this.getColony().food_storage);
		if (this.getColony().food_storage > 50)
		{
			this.getColony().antCreate();
			this.getColony().food_storage -= 50;
		}
	}
}
